package com.aracky.flowable.service;

import com.aracky.common.vo.PageVO;
import com.aracky.flowable.model.dto.StartFlowableDTO;
import com.aracky.flowable.model.request.StartFlowableRequest;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.runtime.Execution;
import org.springframework.http.ResponseEntity;

import java.util.List;

public interface ProcessService {

    /**
     * 查看流程图
     * @param
     * @param processId  流程实例id
     */
    ResponseEntity<byte[]> genProcessDiagram(String processId) ;

    /**

    /**
     * 查询所有启动的流程列表
     * @param flowableRequest
     * @return
     */
    PageVO<Execution> executions(StartFlowableRequest flowableRequest);


    /**
     *终止流程
     * @param processInstanceId
     * @param reason 原因
     * @return string
     */
    String deleteProcessInstanceById(String processInstanceId,String reason);

    /**
     *挂起流程实例
     * @param processInstanceId
     * @return string
     */
    String handUpProcessInstance(String processInstanceId);

    /**
     *（唤醒）被挂起的流程实例
     * @param processInstanceId
     * @return string
     */
    String activateProcessInstance(String processInstanceId);

    /**
     *判断传入流程实例在运行中是否存在
     * @param processInstanceId
     * @return 布尔
     */
    Boolean isExistProcIntRunning(String processInstanceId);

    /**
     *我发起的流程实例列表
     * @param userId
     * @return list
     */
    List<HistoricProcessInstance> getMyStartProcint(String userId);
}
